<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="lib/jquery-3.2.1.js"></script>
    <link rel="stylesheet" href="css/index.css">
</head>
<body>
    <div class="content">
        <img class="ganzi" src="images/play-item.png" alt="">
        <img class="bg" src="images/bg.png" alt="">
        <img class="play-btn" src="images/pause.png" alt="">
    </div>
    <script>
        var isPlay = false;
        $(".play-btn").click(function(){
            if(isPlay){
                isPlay = false
                $(this).attr("src","images/pause.png")
                $(".bg").css({"animationPlayState":"paused"})
                $(".ganzi").css({"animation-direction":"reverse","animation": "animate2 0.5s linear", "animationFillMode": "forwards" })
            }else{
                isPlay = true;
                $(this).attr("src","images/play.png")
                $(".bg").css({"animationPlayState":"running","animation-delay": "0.5s"})
                $(".ganzi").css({"animation-direction":"reverse","animation": "animate1 0.5s linear", "animationFillMode": "forwards" })
            }
        })
    </script>
</body>
</html>